package com.mp.approvalreq.entity.dto;

import java.math.BigDecimal;
import java.util.Objects;

public class ConditionFlowDTO {
	
	private Integer id;
	private Integer templateId;
	/**
	 * 条件类型 1:金额，2:时长
	 */
	private String conditionType;
	/**
	 * 关联的num，格式：xx,xx
	 */
	private String relaComponentNum;
	/**
	 * 条件计算类型：1：比较，2：在某某范围内
	 */
	private Integer conditionCalculationType;
	/**
	 * 比较条件下的最小因子
	 */
	private BigDecimal smallerFactor;
	/**
	 * 比较条件下的最大因子
	 */
	private BigDecimal greaterFactor;
	/**
	 * 左侧符号 0.小于; 1.小于等于 （默认0）
	 */
	private int leftSymbol;
	/**
	 * 右侧符号 0.小于; 1.小于等于 （默认1）
	 */
	private int rightSymbol;
	/**
	 * 范围条件下的范围，数据以xx,xx,xx保存
	 */
	private String range;
	/**
	 * 审批流，xx,xx,xx
	 */
	private String requestFlow;
	/**
	 * 是否支持灵活审批,0不1是
	 */
	private Integer isAllowedToEditJudger;
	/**
	 *   2018-06-12
	 *   单位类型:
	 *      条件类型为金额时,0为元
	 *      条件类型为时长时,0为天,1为小时
	 */
	private Integer unitType;
	
	public ConditionFlowDTO() {
	}
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getTemplateId() {
		return templateId;
	}
	
	public void setTemplateId(Integer templateId) {
		this.templateId = templateId;
	}
	
	public String getConditionType() {
		return conditionType;
	}
	
	public void setConditionType(String conditionType) {
		this.conditionType = conditionType;
	}
	
	public String getRelaComponentNum() {
		return relaComponentNum;
	}
	
	public void setRelaComponentNum(String relaComponentNum) {
		this.relaComponentNum = relaComponentNum;
	}
	
	public Integer getConditionCalculationType() {
		return conditionCalculationType;
	}
	
	public void setConditionCalculationType(Integer conditionCalculationType) {
		this.conditionCalculationType = conditionCalculationType;
	}
	
	public BigDecimal getSmallerFactor() {
		return smallerFactor;
	}
	
	public void setSmallerFactor(BigDecimal smallerFactor) {
		this.smallerFactor = smallerFactor;
	}
	
	public BigDecimal getGreaterFactor() {
		return greaterFactor;
	}
	
	public void setGreaterFactor(BigDecimal greaterFactor) {
		this.greaterFactor = greaterFactor;
	}

	public int getLeftSymbol() {
		return leftSymbol;
	}

	public void setLeftSymbol(int leftSymbol) {
		this.leftSymbol = leftSymbol;
	}

	public int getRightSymbol() {
		return rightSymbol;
	}

	public void setRightSymbol(int rightSymbol) {
		this.rightSymbol = rightSymbol;
	}

	public String getRange() {
		return range;
	}
	
	public void setRange(String range) {
		this.range = range;
	}
	
	public String getRequestFlow() {
		return requestFlow;
	}
	
	public void setRequestFlow(String requestFlow) {
		this.requestFlow = requestFlow;
	}
	
	public Integer getIsAllowedToEditJudger() {
		return isAllowedToEditJudger;
	}
	
	public void setIsAllowedToEditJudger(Integer isAllowedToEditJudger) {
		this.isAllowedToEditJudger = isAllowedToEditJudger;
	}
	
	public Integer getUnitType() {
		return unitType;
	}
	
	public void setUnitType(Integer unitType) {
		this.unitType = unitType;
	}
	
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		ConditionFlowDTO that = (ConditionFlowDTO) o;
		return Objects.equals(id, that.id) &&
				Objects.equals(templateId, that.templateId) &&
				Objects.equals(conditionType, that.conditionType) &&
				Objects.equals(relaComponentNum, that.relaComponentNum) &&
				Objects.equals(conditionCalculationType, that.conditionCalculationType) &&
				Objects.equals(smallerFactor, that.smallerFactor) &&
				Objects.equals(greaterFactor, that.greaterFactor) &&
				Objects.equals(range, that.range) &&
				Objects.equals(requestFlow, that.requestFlow) &&
				Objects.equals(isAllowedToEditJudger, that.isAllowedToEditJudger) &&
				Objects.equals(unitType, that.unitType);
	}
	
	@Override
	public int hashCode() {
		return Objects.hash(id, templateId, conditionType, relaComponentNum, conditionCalculationType, smallerFactor, greaterFactor, range, requestFlow, isAllowedToEditJudger, unitType);
	}
	
	@Override
	public String toString() {
		return "ConditionFlowDTO{" +
				"id=" + id +
				", templateId=" + templateId +
				", conditionType='" + conditionType + '\'' +
				", relaComponentNum='" + relaComponentNum + '\'' +
				", conditionCalculationType=" + conditionCalculationType +
				", smallerFactor=" + smallerFactor +
				", greaterFactor=" + greaterFactor +
				", range='" + range + '\'' +
				", requestFlow='" + requestFlow + '\'' +
				", isAllowedToEditJudger=" + isAllowedToEditJudger +
				", unitType=" + unitType +
				'}';
	}
}
